<div id="inline3" style="width:300px;">
<?php foreach($find_schedule as $item): ?>
  <h2><span>详细数据</span></h2>
        <table class="table_g">
        	<tr>
            	<td class="name">日程标题：</td>
                <td>&nbsp;</td>
                <td><?= $item->subject?></td>
            </tr>
            <tr>
                <td class="name">重要程度：</td>
                <td>&nbsp;</td>
                <td><?= $item->importance?></td>
			</tr>
        	<tr>
            	<td valign="top" class="name">内容：</td>
                <td>&nbsp;</td>
                <td height="60" align="left" valign="top"><div style=" width:212px; line-height:18px; font-size:12px;"><?= $item->content?></div></td>
            </tr>
            <tr><td colspan="3">&nbsp;</td></tr>
			<tr>
                <td class="name">状态：</td>
                <td>&nbsp;</td>
                <td><?= $item->status?></td>
            </tr>
            <tr>
                <td class="name">提前提醒：</td>
                <td>&nbsp;</td>
                <td>
               	  <?php if($item->advance_date):?>
               	    <?php echo $item->advance_date;?>天
               	  <?php endif;?>
                </td>
            </tr>
            <tr><td colspan="3">&nbsp;</td></tr>
            <tr class="sub">
              <td colspan="3">
              <?php 
              	$role=$this->session->userdata('role');
              	$id=$this->session->userdata('id');
              	if($role == '经理'){
              		if($id == $user_id){ /*经理自身任务*/ ?>
              			<input id="jiajia" type="reset" value="编辑" />
              	 		&nbsp;&nbsp;&nbsp;&nbsp;
               			<input type="button" id="delete" value="删除" /></td>
              		<?php } ?>
              	<?php }else{ ?>
              		<input id="jiajia" type="reset" value="编辑" />
              	 	&nbsp;&nbsp;&nbsp;&nbsp;
               		<input type="button" id="delete" value="删除" /></td>
              	<?php } ?>
            </tr>
            <tr><td colspan="3">&nbsp;</td></tr>
        </table>
</div>
<div id="inline4" style="width:300px;">
<form action="index.php/schedule/update_edit/" method="post" name="myform">
  <h2>详细数据</h2>
        <table class="table_g">
        	<tr>
            	<td align="right" bgcolor="#E5E5E5"  class="name">日程标题：</td>
                <td>&nbsp;</td>
                <td><input style="width:207px;" type="text" name="subject" value=<?= $item->subject?> /></td>
            </tr>
            <tr>
                <td class="name">重要程度：</td>
                <td>&nbsp;</td>
                <td>
                    <select name="importance">
                      <option class="option_bg1" value="普通" <?php if($item->importance == '普通'):?> selected="selected" <?php endif;?>>普通</option>
                      <option class="option_bg2" value="重要" <?php if($item->importance == '重要'):?> selected="selected" <?php endif;?>>重要</option>
                      <option class="option_bg3" value="非常重要" <?php if($item->importance == '非常重要'):?> selected="selected" <?php endif;?>>非常重要</option>
                  </select>
                </td>
			</tr>
        	<tr>
            	<td valign="top" class="name">内容：</td>
                <td>&nbsp;</td>
                <td><textarea style=" width:207px;  height:60px; line-height:20px; font-size:12px;" name="content"><?= $item->content?></textarea></td>
            </tr>
            <tr><td colspan="3">&nbsp;</td></tr>
			<tr>
                <td class="name">状态：</td>
                <td>&nbsp;</td>
                <td>
               	  <select name="status">
                        <option value="未开始" <?php if($item->status == '未开始'):?> selected="selected" <?php endif;?>>未开始</option>
                        <option value="执行中" <?php if($item->status == '执行中'):?> selected="selected" <?php endif;?>>执行中</option>
                        <option value="取消" <?php if($item->status == '取消'):?> selected="selected" <?php endif;?>>取消</option>
                        <option value="完成" <?php if($item->status == '完成'):?> selected="selected" <?php endif;?>>完成</option>
                  </select>
                </td>
            </tr>
            <tr>
                <td class="name">提前提醒：</td>
                <td>&nbsp;</td>
                <td>
               	  <select name="advance_date" id="advance_date">
               	   <?php for($d=1;$d<=30;$d++):?>
               	    	<option value="<?php echo $d;?>" <?php if($d == $item->advance_date){ ?>selected='selected'<?php } ?>><?php echo $d;?>天</option>
               	    <?php endfor;?>
                  </select>
                </td>
            </tr>
            <tr><td colspan="3">&nbsp;</td></tr>
            <tr class="sub">
              <td colspan="3"><input type="submit" value="提交" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="重置" /></td>
            </tr>
            <tr><td colspan="3">&nbsp;</td></tr>
        </table>
        <input type="hidden" name="schedule_id" id="schedule_id" value="<?= $item->schedule_id?>" />
		<input type="hidden" name="create_time" value="<?= $item->create_time?>" ></input>
		<input type="hidden" name="execution_time" value="<?= $item->execution_time?>" />
</div>
</form>
 <?php endforeach; ?>
<script type="text/javascript">
	$(document).ready(function(){
		$("#inline4").hide();
		$("#jiajia").click(function(){
			$("#inline3").hide();
			$("#inline4").show();
		});

		$("#delete").click(function(){
			if (window.confirm("您确定要删除吗？")) {
              var id=$("#schedule_id").val();
              location.href="<?=base_url()?>index.php/schedule/delete/"+id+"";
              } else {
            }
		})
	});
</script>

